﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="telephone=no" name="format-detection" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />

    <title>爱农人生意参谋</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    <link href="~/Scripts/light7-build/dist/css/light7.css" rel="stylesheet" />
    <link href="~/Scripts/light7-build/dist/css/light7.min.css" rel="stylesheet" />
    <link href="~/Scripts/light7-build/dist/css/light7-swiper.min.css" rel="stylesheet" />
    <link href="~/Scripts/light7-build/dist/css/light7-swipeout.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-3.2.1.min.js"></script>
    <script src="~/Scripts/light7-build/dist/js/light7.min.js"></script>
    <script src="~/Scripts/light7-build/dist/js/light7-swiper.min.js"></script>
    <script src="~/Scripts/light7-build/dist/js/light7-swipeout.js"></script>
    <script src="~/Scripts/light7-build/dist/js/light7-city-picker.min.js"></script>
</head>
<body>
    <div class="page" style="background:#2E8B57">

        <!-- 页面内容区 -->
        <div class="content">
            <div class="page-login">
                <div class="list-block inset text-center">
                    <div class="row others">
                        <a class="col-100"><img src="~/Scripts/light7-build/img/qnj2.png" width="150"></a>
                    </div>
                    <h3 style="position: relative;top: -50px;color:#ffffff">趣你加数据统计</h3>
                    <ul>
                        <li>
                            <div class="item-content">
                                <div class="item-media"><i class="icon icon-form-name"></i></div>
                                <div class="item-inner">
                                    <div class="item-input">
                                        <input type="text" id="UserName" placeholder="用户名">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-media"><i class="icon icon-form-password"></i></div>
                                <div class="item-inner">
                                    <div class="item-input">
                                        <input type="password" id="UserPass" placeholder="密码">
                                    </div>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="content-block">
                    <p><a class="button button-big button-fill external" style="background:#EE7600" onclick="return ClickLogin();" data-transition="fade">登录</a></p>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function ClickLogin() {
            var UserName = $("#UserName").val();
            var UserPass = $("#UserPass").val();
            if (UserName == "" || UserName == null) {
                $.alert("请输入用户名");
                return false;
            }
            if (UserPass == "" || UserPass == null) {
                $.alert("密码不正确");
                return false;
            }
            $.ajax({
                async: false,
                type: "post",
                url: '@Url.Action("UserLogin")',
                data: {
                    userName: UserName,
                    userPass: UserPass
                },
                success: function (result) {
                    if (result == "1") {
                        // window.location = "PurchaEdit/Index";
                        window.location = '@Url.Action("Index", "PurchaEdit")';
                    } else if (result == "-2") {
                        $.alert("用户名不存在");
                        return false;
                    } else if (result == "-3") {
                        $.alert("您的账户还未激活");
                        return false;
                    } else {
                        $.alert("密码错误");
                        return false;
                    }
                }
            });
        }
    </script>
</body>
</html>
